const express = require('express')
const router = express.Router()
const booksList = require('../../controller/booksList.controller')

/**
 * @swagger
 * /books/list:
 *    get:
 *      tags:
 *      - 书签列表
 *      summary: 获取所有书签列表(如果有书签id则获取书签下的书签列表)
 *      produces:
 *      - application/json
 *      parameters:
 *      - name: page
 *        in: query
 *        description: 页码
 *        required: false
 *        type: string
 *      - name: limit
 *        in: query
 *        description: 每页数量
 *        required: false
 *        type: string
 *      - name: books_id
 *        in: query
 *        description: 书签id
 *        required: false
 *        type: string
 */
router.get('/books/list', booksList.getBooksList)

/**
 * @swagger
 * /books/list/add:
 *    post:
 *      tags:
 *      - 书签列表
 *      summary: 添加书签列表
 *      produces:
 *      - application/json
 *      parameters:
 *      - name: books_name
 *        in: query
 *        description: 书签列表名称
 *        required: true
 *        type: string
 *      - name: books_desc
 *        in: query
 *        description: 书签列表描述
 *        required: false
 *        type: string
 *      - name: status
 *        in: query
 *        description: 书签列表状态
 *        required: false
 *        type: string
 */
router.post('/books/list/add', booksList.addBooksList)

/**
 * @swagger
 * /books/list/update:
 *    patch:
 *      tags:
 *      - 书签列表
 *      summary: 修改书签列表
 *      produces:
 *      - application/json
 *      parameters:
 *      - name: books_id
 *        in: query
 *        description: 书签列表id
 *        required: true
 *        type: string
 *      - name: books_name
 *        in: query
 *        description: 书签列表名称
 *        required: true
 *        type: string
 *      - name: books_desc
 *        in: query
 *        description: 书签列表描述
 *        required: true
 *        type: string
 *      - name: status
 *        in: query
 *        description: 书签列表状态
 *        required: false
 *        type: string
 */
router.patch('/books/list/update', booksList.updateBooksList)

/**
 * @swagger
 * /books/list/delete:
 *    delete:
 *      tags:
 *      - 书签列表
 *      summary: 删除书签列表
 *      produces:
 *      - application/json
 *      parameters:
 *      - name: books_id
 *        in: query
 *        description: 书签列表id
 *        required: true
 *        type: string
 */
router.delete('/books/list/delete', booksList.deleteBooksList)

module.exports = router
